home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
uniq.zip
/
UNIQ.MAN
< prev
Wrap
Text File
|
1994-05-23
|
2KB
|
80 lines
UNIQ(1) USER COMMANDS UNIQ(1)
NAME
uniq - remove or report adjacent duplicate lines
AUTHOR
Jason Mathews
NASA/Goddard Space Flight Center
Code 633.2
Greenbelt, Maryland 20771
<mathews@nssdca.gsfc.nasa.gov>
COPYRIGHT
Copyright (C) 1992-94 by Jason Mathews. Permission is granted to any
individual or institution to use, copy or modify this software so
long as it is not sold for profit, provided this copyright notice
is retained.
SYNOPSIS
uniq [-c | -d | -u] [ +|-n ] [ inputfile [ outputfile ] ]
DESCRIPTION
The uniq command reads standard input by default, or input_file, compares
adjacent lines, removes the second and succeeding occurrences of a line,
and writes to standard output or the specified file output_file.
Repeated lines must be on consecutive lines to be found. You can arrange
them with the sort command before processing.
OPTIONS
-c Supersede -u and -d and generate an output report in
default style but with each line preceded by a count of
the number of times it occurred.
The normal output of uniq is the union of the -u and -d
options.
-d Write one copy of just the repeated lines.
-u Copy only those lines which are not repeated in the
original file.
The n arguments specify skipping an initial portion of each
line in the comparison:
-n The first n fields together with any blanks before
each are ignored. A field is defined as a string of
non-SPACE, non-TAB characters separated by SPACE and
TAB characters from its neighbors.
+n The first n characters are ignored. Fields are
skipped before characters.
EXAMPLES
To delete repeated lines in the following file called fruit and save it to
a file named newfruit, enter:
uniq fruit newfruit
The file fruit contains the following lines:
apples
apples
bananas
cherries
cherries
peaches
pears
The file newfruit contains the following lines:
apples
bananas
cherries
peaches
pears
MS-DOS Release 1.1 Last change: 23 May 1994